home *** CD-ROM | disk | FTP | other *** search
- /*
- File: FindSpecialFolder.h
-
- Contains: FindSpecialFolder call to replace FindFolder for usage in action atoms, and allow them to be int'l friendly.
-
- Written by: Chris Hansten, but most of the code is extracted from Installer 4.5. Thanks Kevin!
-
- Copyright: © 1996 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <1> 3/8/96 CEH Created
-
- */
-
- #ifndef __FINDSPECIALFOLDER__
- #define __FINDSPECIALFOLDER__
-
- // ****************
- // *** Includes ***
- // ****************
-
- #include "ActionAtomIntf.h"
- #include "Types.h"
-
- // ***************
- // *** DEFINES ***
- // ***************
-
- // Note: The items below should not change. For example, if a new Installer application goes to a new signature rsrc type
- // and creator we will need to recompile. I will rewrite that portion of the code later
-
- #define kBlessedFolderNameStrRsrcID 3500 /* The ID of the STR rsrc that has the name of blessed folder ("System Folder") we create */
- #define kSpecialExtensionStrRsrcID 3501 /* The ID of the STR rsrc used internally to identify the script. */
- #define kInstallerSigRsrcType 'kajr' /* Type of signature string of Installer app */
- #define kInstallerSigRsrcID 0 /* ID of signature string of Installer app */
-
-
- // *******************
- // *** Fn Declares ***
- // *******************
-
- // ----- FindSpecialFolder -----
- // Purpose: This is a replacement for the FindFolder function. Instead of using the fld# resource in the running
- // System, which FindFolder does by default, it uses the same logic as the Installer application to decide
- // which fld# is appropriate. This logic is described below.
- // Assumptions: None
- //
- // Ins: theVRefNum - The volume reference number of the volume on which we want to locate the directory
- // folderType - type of folder we're looking for, might be kAnyFolderType.
- // createFolder - pass in constant kCreateFolder to create dir if it doesn't already exist; otherwise pass in kDontCreateFolder
- // useSpecialFolders - Not important, but retained for consistency with original installer call. You MUST pass true in this param
- //
- // Outs: foundVRefNum - The volume reference number returned for the volume containing the directory specified in the folderType param
- // foundDirID - The dirID number returned for the directory specified in the folderType param
- // folderName - The folder name found is returned in this parameter.
- //
- // Which fld# (folder list resource) should we use? Well, if you do a clean install of French SSW with US SSW running
- // on the system, the fld# in the running System is English. However, the system we are installing is a French system,
- // so we cannot simply do a FindFolder call and expect it to work. We must look for the "best" fld# to use.
- //
- // We should use, in decreasing order of preference:
- //
- // 1. The script's fld# resource should be first because it is under
- // script writer's control. If the number of special folders has
- // increased, the script writer should include an fld# resource
- // in his script to reflects this change. The fld# resource in
- // the script should probably be the same as the fld# in the new
- // system file.
- //
- // 2. The target system's should examined second because we might be
- // installing a language module into the an existing System Folder.
- // Since it could be any region, the only way is to get the fld#
- // from the system we will be updating.
- //
- // 3. The installer's fld# should be used as a last resort. It is most
- // likely to be out of date. The only reason it would be used is when
- // we are running on a system that does not have a folder manager.
-
- OSErr FindSpecialFolder(short theVRefNum, OSType folderType, Boolean createFolder, short *foundVRefNum, long *foundDirID, Boolean useSpecialFolders, StringPtr folderName);
-
-
- #endif
-